package team.kirohuji.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import team.kirohuji.domain.User;
import team.kirohuji.utils.ShiroUtils;

/**
 * 
 * 这个类用来获取当前登录到系统的用户
 * 
 * @author kirohuji
 * @version 0.1
 * 
 */
public abstract class AbstractController {
	protected Logger logger = LoggerFactory.getLogger(getClass());

	/**
	 * 获取用户
	 * 
	 * @return User
	 */
	protected User getUser() {
		return ShiroUtils.getUserEntity();
	}

	/**
	 * 获取用户SessionId
	 * 
	 * @return Integer
	 */
	protected Integer getUserId() {
		return ShiroUtils.getUserId();
	}
}
